/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Yeezus
 */
@Entity
@NamedQueries({
    @NamedQuery(name = "findAllFuncsArmazem",
    query = "SELECT f FROM FuncArmazem f ORDER BY f.nome")})
public class FuncArmazem extends Funcionario implements Serializable {

    @ManyToOne
    @NotNull
    @JoinColumn(name = "FARMACIA_ID")
    private Farmacia farmacia;

    public FuncArmazem() {
    }

    public FuncArmazem(String username, String nome, String password, String email, Farmacia farmacia) {
        super(username, nome, GrupoFuncionario.GRUPO.FuncionarioArmazem, password, email);
        this.farmacia = farmacia;
    }

    public Farmacia getFarmacia() {
        return farmacia;
    }

    public void setFarmacia(Farmacia farmacia) {
        this.farmacia = farmacia;
    }
}
